package com.sky.mapper;

import com.sky.anno.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据 菜品的id 查看 套餐id表 是不是与套餐关联
     * @param ids
     * @return
     */
    List<SetmealDish> getDishIdById(List<Long> ids);

    /**
     * 新增套餐对应的菜品
     * @param setmealDishes
     */

    void insert(List<SetmealDish> setmealDishes);

    /**
     * 查询套餐对应的菜品
     * @param setmealId
     * @return
     */
    @Select("select * from  setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteById(Long setmealId);

    void deleteBarch(List<Long> setmealids);
}
